from common.base import *


# 打开浏览器
driver = webdriver.Chrome()
driver.maximize_window()
# 请求百度
driver.get('https://www.baidu.com')
# 准备cookie
cookies = [
    {
        'name': 'BDUSS',
        'value': 'JvLWxYMmZJSjFtVDdOdDEzLX44fjlldHB2b1lhOU8tb3ZYfngyWFZaQmYxRnRpRVFBQUFBJCQAAAAAAAAAAAEAAACN~0PR6V9jYXIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAF9HNGJfRzRiY3'
    },
    {
        'name': 'BCLID_BFESS',
        'value': '11441140803292780919'
    }
]

# 添加cookie
driver.add_cookie(cookies[0])
driver.add_cookie(cookies[1])
# 刷新浏览器
driver.refresh()
# 关闭浏览器
sleep(5)
driver.quit()
